package com.bjc.platform.util;

import java.util.Map;

/**
 * EXCEL导出列定义
 * @author BJC
 *
 */
public class ExcelColumnDefinition {

	/**
	 * 列属性
	 * 指定如何从数据集的行中获取值，支持嵌套属性。例如：map.key, bean.property, array[n], list[n]
	 */
	private String property;
	
	/**
	 * 列标题
	 */
	private String title;
	
	/**
	 * 列宽度
	 */
	private short width = 2625;
	
	/**
	 * 列数据类型，参见ExcelExporter.TYPE_XXX
	 * @see ExcelExporter
	 */
	private String type;
	
	/**
	 * 自定义数据格式，主要用于日期和数值型
	 */
	private String pattern;
	
	/**
	 * 用于字典转换
	 */
	private Map<String, String> dict;

	public ExcelColumnDefinition() {
		
	}
	
	public ExcelColumnDefinition(String property, String title, short width) {
		this.property = property;
		this.title = title;
		this.width = width;
	}

	public ExcelColumnDefinition(String property, String title, short width,
			String type, String pattern) {
		this.property = property;
		this.title = title;
		this.width = width;
		this.type = type;
		this.pattern = pattern;
	}

	public ExcelColumnDefinition(String property, String title, short width,
			String type, Map<String,String> dict) {
		this.property = property;
		this.title = title;
		this.width = width;
		this.type = type;
		this.dict = dict;
	}
	
	public String getProperty() {
		return property;
	}
	public void setProperty(String property) {
		this.property = property;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public short getWidth() {
		return width;
	}
	public void setWidth(short width) {
		this.width = width;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getPattern() {
		return pattern;
	}
	public void setPattern(String pattern) {
		this.pattern = pattern;
	}	
	public Map<String, String> getDict() {
		return dict;
	}
	public void setDict(Map<String, String> dict) {
		this.dict = dict;
	}
}
